package com.bjb.vr.common.dto;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 
 * @TableName sys_dept
 */
@TableName(value ="sys_dept")
@Data
public class SysDept extends BaseModel implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id")
    private String tenantId;

    /**
     * 数据ID用于同步
     */
    @TableField(value = "data_id", fill = FieldFill.INSERT)
    private Long dataId;

    /**
     * 部门名称（根节点为租户名称）
     */
    @TableField(value = "dept_name")
    private String deptName;

    /**
     * 上级部门ID（根节点为0）
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 负责人账号ID
     */
    @TableField(value = "leader_id")
    private Long leaderId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    @TableField(value = "gmt_modified", fill = FieldFill.UPDATE)
    private LocalDateTime gmtModified;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}